#include "scripting.h"

#include <fstream>
#include <iostream>

void ScrLoadScript(string sPath)
{
    fstream file;
    file.open(sPath.c_str(), ios::in | ios::out);
    while(file)
    {
        vector<string> sCommand;

        string sWord;

        while(true)
        {
            file >> sWord;

            if(sWord[sWord.length()-1] == ';')
            {
                sWord.erase(sWord.length()-1);
                sCommand.push_back(sWord);

                break;
            }
            if(!file) break;

            sCommand.push_back(sWord);
        }

        ScrParse(sCommand);
    }
    file.close();
}
